package org.jeecg.modules.tplus.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.jeecg.common.aspect.annotation.FieldName;

import java.math.BigDecimal;

/**
 * 存货信息
 *
 * @author hzq
 */
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class InventoryEntityReqDto {

    /**
     * 存货编码
     */
    @Schema(description = "存货编码")
    @JsonProperty(value = "Code")
    @FieldName(name = "存货编码", value = "code")
    private String code;

    /**
     * 存货名称
     */
    @Schema(description = "存货名称")
    @JsonProperty(value = "Name")
    @FieldName(name = "存货名称", value = "name")
    private String name;

    /**
     * 英文名称
     */
    @Schema(description = "英文名称")
    @JsonProperty(value = "Specification")
    @FieldName(name = "英文名称", value = "specification")
    private String specification;

    /**
     * 计价方式
     */
    @Schema(description = "计价方式")
    @JsonProperty(value = "ValueType")
    @FieldName(name = "计价方式", value = "ValueType")
    private ValueType valueType;

    @Data
    public static class ValueType {
        /**
         * 编码
         */
        @Schema(description = "编码")
        @JsonProperty(value = "Code")
        private String code;
    }

    /**
     * 是否单计量
     */
    @Schema(description = "是否单计量")
    @JsonProperty(value = "IsSingleUnit")
    @FieldName(name = "是否单计量", value = "IsSingleUnit")
    private Boolean isSingleUnit = true;

    /**
     * 计量单位类型
     */
    @Schema(description = "计量单位类型")
    @JsonProperty(value = "UnitType")
    @FieldName(name = "计量单位", value = "UnitType")
    private UnitType unitType = new UnitType();

    @Data
    public static class UnitType {
        /**
         * 编码
         */
        @Schema(description = "编码")
        @JsonProperty(value = "Code")
        private String code = "00";
    }

    /**
     * 计量单位
     */
    @Schema(description = "计量单位")
    @JsonProperty(value = "Unit")
    @FieldName(name = "计量单位", value = "unit")
    private Unit unit;

    @Data
    public static class Unit {
        /**
         * 计量单位编码
         */
        @Schema(description = "计量单位编码")
        @JsonProperty(value = "Code")
        private String code;

        /**
         * 名称
         */
        @Schema(description = "名称")
        @JsonProperty(value = "Name")
        private String name;
    }

    /**
     * 存货属性：电商
     */
    @Schema(description = "存货属性：电商")
    @JsonProperty(value = "IsEshop")
    @FieldName(name = "计量单位", value = "isEshop")
    private String isEshop;

    /**
     * 存货属性：外购属性
     */
    @Schema(description = "存货属性：外购属性 ")
    @JsonProperty(value = "IsPurchase")
    @FieldName(name = "存货属性：外购属性 ", value = "isPurchase")
    private String isPurchase;

    /**
     * 是否具有销售属性
     */
    @Schema(description = "是否具有销售属性")
    @JsonProperty(value = "IsSale")
    @FieldName(name = "是否具有销售属性", value = "isSale")
    private String isSale;

    /**
     * 是否具有自制属性
     */
    @Schema(description = "是否具有自制属性")
    @JsonProperty(value = "IsMadeSelf")
    @FieldName(name = "是否具有自制属性", value = "isMadeSelf")
    private String isMadeSelf;

    /**
     * 是否生产耗用
     */
    @Schema(description = "是否生产耗用")
    @JsonProperty(value = "IsMaterial")
    @FieldName(name = "是否生产耗用", value = "isMaterial")
    private String isMaterial;

    /**
     * 是否具有劳务属性
     */
    @Schema(description = "是否具有劳务属性")
    @JsonProperty(value = "IsLaborCost")
    @FieldName(name = "是否具有劳务属性", value = "isLaborCost")
    private String isLaborCost;

    /**
     * 是否具有委外属性
     */
    @Schema(description = "是否具有委外属性")
    @JsonProperty(value = "IsMadeRequest")
    @FieldName(name = "是否具有委外属性", value = "isMadeRequest")
    private String isMadeRequest;

    /**
     * 存货描述
     */
    @Schema(description = "存货描述")
    @JsonProperty(value = "InventoryDescript")
    @FieldName(name = "存货描述", value = "inventoryDescript")
    private String inventoryDescript;

    /**
     * 所属类别
     */
    @Schema(description = "所属类别")
    @JsonProperty(value = "InventoryClass")
    @FieldName(name = "所属类别", value = "inventoryClass.code")
    private InventoryClass inventoryClass;

    @Data
    public static class InventoryClass {
        /**
         * 所属类别编码
         */
        @Schema(description = "所属类别编码")
        @JsonProperty(value = "Code")
        private String code;
    }

    /**
     * 动态属性，包括自定义项和自由项
     */
    @Schema(description = "动态属性，包括自定义项和自由项")
    @JsonProperty(value = "DynamicPropertyKeys")
    private Object[] dynamicPropertyKeys;

    /**
     * 动态属性的值，对应DynamicPropertyKeys
     */
    @Schema(description = "动态属性的值，对应DynamicPropertyKeys")
    @JsonProperty(value = "DynamicPropertyValues")
    private Object[] dynamicPropertyValues;

    /**
     * 助记码
     */
    @Schema(description = "助记码")
    @JsonProperty(value = "Shorthand")
    @FieldName(name = "助记码", value = "shorthand")
    private String shorthand;

    /**
     * 是否停用
     */
    @Schema(description = "是否停用")
    @JsonProperty(value = "disabled")
    @FieldName(name = "记录数", value = "Disabled")
    private String disabled;

    /**
     * 默认仓库
     */
    @Schema(description = "默认仓库")
    @JsonProperty(value = "Warehouse")
    @FieldName(name = "默认仓库", value = "Warehouse")
    private Warehouse warehouse;

    @Data
    public static class Warehouse {

        /**
         * 仓库编码
         */
        @Schema(description = "仓库编码")
        @JsonProperty(value = "Code")
        private String code;
    }

    /**
     * 默认货位
     */
    @Schema(description = "默认货位")
    @JsonProperty(value = "InvLocation")
    @FieldName(name = "默认货位", value = "InvLocation")
    private InvLocation invLocation;

    @Data
    public static class InvLocation {

        /**
         * 编码
         */
        @Schema(description = "编码")
        @JsonProperty(value = "Code")
        private String code;
    }

    /**
     * 默认供应商
     */
    @Schema(description = "默认供应商")
    @JsonProperty(value = "Partner")
    @FieldName(name = "默认供应商", value = "Partner")
    private Partner partner;

    @Data
    public static class Partner {

        /**
         * 编码
         */
        @Schema(description = "编码")
        @JsonProperty(value = "Code")
        private String code;
    }

}
